import Button from "components/Base/Button";
import Icon from "components/Base/Icon";
import DataTable from "components/Base/DataTable";
import Image from "components/Base/Image";
import {memberLevelDict} from "../../../../../models/MemberLevel";

export default (self) => [

  {
    title: 'id',
    name: 'id',
    formItem: {
      type: 'hidden',
    }
  },
  {
    title: '会员等级',
    name: 'memberLevel',
    tableItem: {},
    formItem: {
      rules: [
        {
          required: true,
          message: '请选择会员等级'
        }
      ],

      showSearch: true,
      type: 'select',
    },
    dict: memberLevelDict,
  },

  {
    title: '佣金百分比',
    name: 'commissionRatio',
    tableItem: {
    },
    formItem: {
      rules: [
        {
          required: true,
          message: '请输入佣金比例'
        }
      ],
      type: 'number',
      max: 100,
      initialValue: 0,
    },
  },

  {
    title: '分销百分比',
    name: 'drpRatio',
    tableItem: {
    },
    formItem: {
      rules: [
        {
          required: true,
          message: '请输入佣金比例'
        }
      ],
      type: 'number',
      max: 100,
      initialValue: 0,
    },
  },


  {
    title: '操作',
    tableItem: {
      width: 180,
      align: 'center',
      render: (text, record) => (
        <DataTable.Oper>
          <Button tooltip="修改" onClick={e => self.onUpdate(record)}>
            <Icon type="edit"/>
          </Button>
          <Button tooltip="删除" onClick={e => self.onDelete(record)}>
            <Icon type="trash"/>
          </Button>
        </DataTable.Oper>
      )
    }
  }
]
